package cn.yuxiaoyuan.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author solargen
 * @version 1.0
 * @date 2025/5/19 11:11
 */
@Component
public class PermissionScanListener implements CommandLineRunner {
    @Autowired
    private PermissionScan permissionScan;
    @Override
    public void run(String... args) throws Exception {
        new Thread(()->{
            //我们需要开一个线程去执行  为什么
            System.out.println(permissionScan);
            permissionScan.scanPermission(); //扫描注解
        }).start();
    }
}
